package com.example.chapter04;


import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MyInterceptor1 implements HandlerInterceptor {
@Override
public boolean preHandle (HttpServletRequest request,
                          HttpServletResponse response,
                          Object handler) {
    System.out.println("MyInterceptor1>>>preHandle");
    return true;
   }
        @Override
        public void postHandle(HttpServletRequest request ,
                               HttpServletResponse response ,
                               Object handler,
                               ModelAndView modelAndView) {
            System.out.println("MyInterceptor1>>>postHandle");
   }
        @Override
            public void afterCompletion(HttpServletRequest request,
                    HttpServletResponse response,
                    Object handler,
                    Exception ex){
                System.out.println(" MyInterceptor1 >>> afterCompletion");
            }
}